package com.xy.biz.rs.domain.converter;

import java.util.Collection;
import java.util.List;

import com.xy.biz.rs.domain.resp.GetManufactureArchiveRecordResponse;
import com.xy.tool.util.BeanUtilsEx;
import com.xy.biz.rs.domain.bo.ManufactureArchiveRecordBO;
import com.xy.biz.rs.domain.po.ManufactureArchiveRecordPO;
import com.xy.biz.rs.domain.query.ManufactureArchiveRecordQuery;
//import com.xy.biz.rs.domain.resp.GetManufactureArchiveRecordResponse;
//import com.xy.biz.rs.domain.req.SaveManufactureArchiveRecordRequest;
//import com.xy.biz.rs.domain.req.ListManufactureArchiveRecordRequest;

/**
 *
 *
 * @author wwj
 * @date 2021-4-19
 */
public class ManufactureArchiveRecordConverter {

	public static ManufactureArchiveRecordPO toPO(ManufactureArchiveRecordBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureArchiveRecordPO(), true);
	}

	public static List<ManufactureArchiveRecordPO> toPO(Collection<ManufactureArchiveRecordBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureArchiveRecordPO(), true);
	}

	public static ManufactureArchiveRecordBO fromPO(ManufactureArchiveRecordPO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureArchiveRecordBO());
	}

	public static List<ManufactureArchiveRecordBO> fromPO(Collection<ManufactureArchiveRecordPO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureArchiveRecordBO());
	}

//	public static ManufactureArchiveRecordBO toBO(SaveManufactureArchiveRecordRequest source) {
//		return BeanUtilsEx.copyProperties(source, () -> new ManufactureArchiveRecordBO(), true);
//	}
//
//	public static List<ManufactureArchiveRecordBO> toBO(Collection<SaveManufactureArchiveRecordRequest> source) {
//		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureArchiveRecordBO(), true);
//	}
//
//	public static GetManufactureArchiveRecordResponse toResponse(ManufactureArchiveRecordBO source) {
//		return BeanUtilsEx.copyProperties(source, () -> new GetManufactureArchiveRecordResponse());
//	}
//
	public static List<GetManufactureArchiveRecordResponse> toResponse(Collection<ManufactureArchiveRecordBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetManufactureArchiveRecordResponse());
	}
//
//	public static ManufactureArchiveRecordQuery toQuery(ListManufactureArchiveRecordRequest source) {
//		if(null == source) {
//			return null;
//		}
//		ManufactureArchiveRecordQuery target = new ManufactureArchiveRecordQuery(source.getPageIndex(), source.getPageSize());
//		BeanUtilsEx.copyProperties(source, target);
//		return target;
//	}

}
